/*
 * player.h
 *
 *  Created on: 15 nov. 2010
 *      Author: Nicolas Aucouturier, Laurent R�veill�re
 */

#ifndef PLAYER_H_
#define PLAYER_H_

#include <stdio.h>
#include <stdlib.h>
#include "SDL.h"
#include "SDL_image.h"
#include "../include/constant.h"

enum e_way {
	NORTH = 0, SOUTH, WEST, EAST
};
typedef enum e_way direction;

typedef struct s_player * t_player;


// Creates a new player with a given number of available bombs
extern t_player player_init(int bomb_number,int life_number);
extern void player_free(t_player player);


// Returns the current position of the player
extern int player_get_x(t_player player);
extern int player_get_y(t_player player);

// Set the direction of the next move of the player
extern void player_set_current_way(t_player player, enum e_way way);
extern enum e_way player_get_current_way(t_player player);

// Set, Increase, Decrease the number of bomb that player can put
extern int player_get_nb_bomb(t_player player);
extern void player_inc_nb_bomb(t_player player);
extern void player_dec_nb_bomb(t_player player);

// Set, Increase, Decrease the number of bomb that player can put
extern int player_get_nb_life(t_player player);
extern void player_inc_nb_life(t_player player);
extern void player_dec_nb_life(t_player player);


// Load the player position from the map
extern void player_from_map(t_player player, t_map map);

// Move the player according to the current direction
extern int player_move(t_player player, t_map map);

// Display the player on the screen
extern void player_display(t_player player, SDL_Surface *screen);

#endif /* PLAYER_H_ */
